package com.md.youyouhui.ui.home;

import android.databinding.DataBindingUtil;
import android.os.Build;

import com.md.youyouhui.R;
import com.md.youyouhui.databinding.ActivityBannerBinding;
import com.md.youyouhui.ui.BaseActivity;
import com.md.youyouhui.utils.StatusBarHelper;

/**
 * Created by AdministratorZJ
 * on 2019/4/26.
 */
public class BannerViewActivity extends BaseActivity {
    private ActivityBannerBinding bannerBinding;

    @Override
    public void setContentLayout() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            StatusBarHelper.setFullWindow(getWindow());
            StatusBarHelper.setStatusBarTextColor(getWindow(), false);
        }
        bannerBinding = DataBindingUtil.setContentView(this, R.layout.activity_banner);
    }

    @Override
    public void initView() {
        bannerBinding.back.setOnClickListener(v -> finish());
    }

    @Override
    public void initData() {
        int imageId = getIntent().getIntExtra("imageId", 100);
        bannerBinding.bannerView.setEnabled(true);
        if (imageId == 100) {
            return;
        }
        bannerBinding.bannerView.setImage(imageId);
    }
}
